declare var createjs;
declare var ndgmr;

class StageManager {
    stage
    holder;

    constructor() {
        this.stage = new createjs.Stage("demoCanvas");
        this.holder = this.stage.addChild(new createjs.Container());

        // tickers
        createjs.Ticker.removeAllEventListeners();
        createjs.Ticker.on("tick", tick);
        createjs.Ticker.setFPS(30);
    }

    addEntityToStage(entity) {
        this.holder.addChild(entity);
        this.stage.update();
    }

    removeEntityToStage(entity) {
        this.stage.removeChild(entity);
        this.stage.update();
    }

    update() { this.stage.update(); }
    tick() {
        console.log('ghfgj');
    }
}

function dump(obj) {
    var out = '';
    for (var i in obj) {
        out += i + ": " + obj[i] + "\n";
        console.log(out);
    }
}